package com.greenantmall.view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.GestureDetector;
import android.view.MotionEvent;
import android.view.GestureDetector.OnGestureListener;
import it.sephiroth.android.library.widget.HListView;

public class MyHListView extends HListView {
	private GestureDetector mGesture = null;
	
	public MyHListView(Context context) {
		super(context);
	}
	
	public MyHListView(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	public MyHListView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
	}

	@Override
	public boolean dispatchTouchEvent(MotionEvent ev) {
		super.dispatchTouchEvent(ev);
		requestDisallowInterceptTouchEvent(true);
		super.onTouchEvent(ev);
		if (mGesture != null) {
			mGesture.onTouchEvent(ev);
		}
		return true;
	}

	public void setOnGestureListener(OnGestureListener listener) {
		mGesture = new GestureDetector(listener);
	}
}
